Systems and methods for using an opengl api with a vulkan graphics driver

ABSTRACT

A system, method, and computer-readable medium are provided for translating OpenGL API calls to operations in a Vulkan graphics driver using an OpenGL-on-Vulkan driver architecture. An OpenGL-on-Vulkan driver receives an OpenGL context and render function, translates an OpenGL format to a Vulkan format, creates a Vulkan object and sets a Vulkan state, and generates a Vulkan command buffer corresponding to the OpenGL render function.

PRIORITY CLAIM

This application is a continuation of U.S. patent application Ser. No.15/331,078 filed on Oct. 21, 2016, which claims the benefit of U.S.Provisional Patent Application Ser. No. 62/244,480 filed on Oct. 21,2015, by the present inventor(s), and entitled “SYSTEMS AND METHODS FORUSING AN OPENGL API WITH A VULKAN GRAPHICS DRIVER”, the entire contentsof which are hereby incorporated by reference herein for all purposes

TECHNICAL FIELD

The embodiments disclosed herein relate to generating computer graphics,and, in particular to systems and methods for using an OpenGL API with aVulkan graphics driver.

INTRODUCTION

The following paragraphs are not an admission that anything discussed inthem is prior art or part of the knowledge of persons skilled in theart.

In the field of computer graphics on embedded systems, the OpenGL API(of which there are multiple flavors and versions) has lead the industryin a variety of use cases. These use cases range from managing thegraphics in avionics display systems to dashboard gauge clusters inautomotive display systems, and 3D image processing in the medicalfield.

Technological advances in the graphics industry over the past decadehave given rise to sophisticated Graphics Processing Units (GPUs)shifting the balance between serial pipelines to a much moreparallelized approach. The ability to perform separate tasks in parallelas well as the modular architecture of today's GPUs means that for everygraphics need, there are a variety of ways that a solution can bedesigned.

Vulkan has been introduced by the Khronos Consortium as a new modularAPI that is intended to take advantage of current GPUs. The OpenGL API,although less flexible than Vulkan, is still the most widely-used API inthe industry. It is likely to remain the most widely-used API forseveral years to come.

With this in mind, there is a need to provide a Vulkan solution whilesimultaneously recognizing that continued support will be required forOpenGL drivers.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings included herewith are for illustrating various examples ofarticles, methods, and apparatuses of the present specification. In thedrawings:

FIG. 1A is a block diagram of an OpenGL driver architecture;

FIG. 1B is a block diagram of a Vulkan driver architecture;

FIG. 2 is a block diagram of an OpenGL-on-Vulkan driver architecture,according to one embodiment;

FIG. 3 is a block diagram of the OpenGL-on-Vulkan driver architecture ofFIG. 3, in the example of glTexImage2D;

FIG. 4 is a block diagram of the OpenGL-on-Vulkan driver architecture ofFIG. 3, in the example of glDrawArrays;

FIG. 5 is a block diagram of an OpenGL-on-Vulkan driver architectureincluding a translator to Window System Integration (WSI) according toone embodiment;

FIG. 6 is a flow diagram depicting a method for using an OpenGL API witha Vulkan graphics driver according to one embodiment;

FIG. 7. is a diagram showing exemplary performance analysis dataaccording to one embodiment; and

FIG. 8 is another diagram showing exemplary performance data accordingto one embodiment.

DETAILED DESCRIPTION

Various apparatuses or processes will be described below to provide anexample of an embodiment of each claimed invention. No embodimentdescribed below limits any claimed invention and any claimed inventionmay cover processes or apparatuses that differ from those describedbelow. The claimed inventions are not limited to apparatuses orprocesses having all of the features of any one apparatus or processdescribed below or to features common to multiple or all of theapparatuses described below. It is possible that an apparatus or processdescribed below is not an embodiment of any claimed invention. Anyinvention disclosed below that is not claimed in this document may bethe subject matter of another protective instrument, for example, acontinuing patent application, and the applicants, inventors or ownersdo not intend to abandon, disclaim or dedicate to the public any suchinvention by its disclosure in this document.

The embodiments of the systems and methods described herein may beimplemented in hardware or software, or a combination of both. However,preferably, these embodiments are implemented in computer programsexecuting on programmable computers each comprising at least oneprocessor, a data storage system (including volatile and non-volatilememory and/or other storage elements), at least one input device, and atleast one output device. For example and without limitation, theprogrammable computers may be a programmable electronic controller,mainframe computer, server, personal computer, laptop, personal dataassistant, or cellular telephone. Program code is applied to input datato perform the functions described herein and generate outputinformation. The output information is applied to one or more outputdevices, in known fashion.

Each program may be implemented in a high level procedural or objectoriented programming and/or scripting language to communicate with acomputer system. However, the programs can be implemented in assembly ormachine language, if desired. In any case, the language may be acompiled or interpreted language. Each such computer program ispreferably stored on a storage media or a device (e.g. read only memory(ROM) or magnetic diskette) readable by a general or special purposeprogrammable computer, for configuring and operating the computer whenthe storage media or device is read by the computer to perform theprocedures described herein. The inventive system may also be consideredto be implemented as a computer-readable storage medium, configured witha computer program, where the storage medium so configured causes acomputer to operate in a specific and predefined manner to perform thefunctions described herein.

In the field of computer graphics, a person skilled in the art willunderstand that particular terms have specific meanings and definitionsprovided by the OpenGL® standard. Generally speaking, the meanings anddefinitions of specific terms related to the OpenGL standard can bedetermined by referring to the standards and documentation published bythe Khronos Consortium, such as at the website www.khronos.org. Forexample, the terms “context”, “object”, and “state” have specificmeanings.

OpenGL can be viewed as a state machine. Thus, at any particular time,an OpenGL instance can be defined by its particular state. In this view,OpenGL functions can be grouped into three broad categories offunctions. First are those functions that set state into an OpenGLcontext. Second are those functions that can query state. Third arethose functions that preform rendering operations based on state.

An OpenGL context can be thought of as representing an object thatstores the state associated with a particular instance of OpenGL. AnOpenGL context can represent a default frame buffer that render commandscan draw to rather than a framebuffer object.

An OpenGL object is a construct that contains a state. An OpenGL objectcan be bound to a particular context, in which case, the object state ismapped to the state of the context. Thus, changes in the state of thecontext will also be stored in the object, and functions that act on thecontext state will also use the object state. Objects can be classifiedas regular or container objects (or non-standard objects). Examples ofregular objects are buffer objects, query objects, renderbuffer objects,sampler objects, and texture objects. Examples of container objects areframebuffer objects, program pipeline objects, transform feedbackobjects, and vertex array objects. Example of non-standard objects aresync objects and shader or program objects.

A texture object can contain one or more images, where all of the imageshave the same image format. The image format describes the way that datais stored in order to represent the images in texture objects andrenderbuffer objects. In other words, the image format defines themeaning of the data associated with the image.

Referring to FIG. 1A, there is a block diagram of an OpenGL driverarchitecture 100. The OpenGL driver is responsible for taking OpenGL APIcalls from an application, and providing associated hardware-specificinstructions to a Graphics Processing Unit (GPU). The architecture ofthe OpenGL driver is described in terms of a dispatch module 116, amemory manager 102, and operating-system (OS) module 104, a statetracker 118, a render module 120, a carddata module 125, and a hardwareGPU layer 127.

The dispatch module 116 is responsible for marshalling OpenGL API callsmade by an application, to the corresponding function of the statetracker 118. This allows the state tracker 118 to track all statesrelated to the OpenGL context. The state tracker 118 is specificallydesigned to be hardware agnostic so that it does not need to bere-written for different hardware (e.g. GPU) specifications.

Conversely, the render module 120 is hardware specific. In other words,the render module 120 is written for a particular type of hardware (e.g.GPU). Thus, for different GPUs. The render module 120 is responsible fortaking the OpenGL context and OpenGL commands and converting them tohardware-specific state, types, and commands.

The carddata module 125 is the driver layer that sits directly on top ofthe GPU. As with the render module 120, the carddata module 125 ishardware specific. The carddata module 125 receives thehardware-specific state, types, and commands from the render module 120,derives hardware-specific GPU operations, and submits them to the GPU.

The implementation of the OpenGL driver architecture 100 is such thatthe render module 120 and the carddata module 125 (as well as the GPU127) are hardware specific. Thus, for a particular type of GPU 127, itis necessary to write a render module 120 and a carddata module 125 thatwork with the particular type of GPU 127. However, according to someembodiments, other parts of the driver architecture 100 (e.g. thedispatch module 116, the state tracker 118, etc.) may be common acrossdifferent types of GPU 127.

Referring to FIG. 1B, there is a block diagram of a Vulkan driverarchitecture 150. The Vulkan driver architecture 150 comprises adispatch module 166, a memory manager 152, an OS module 154, a rendermodule 124, a carddata module 126, which sits on top of a GPU 125. Thisarchitecture 150 is similar to the OpenGL driver architecture 150,except that the Vulkan driver 150 does not include a state-trackermodule. According to the Vulkan API, most of the state-like information(e.g. analogous to OpenGL state) is in the domain of the applicationitself. As with the OpenGL driver architecture 100 and its analogouscomponents, according to some embodiments, the render module 124 and thecarddata module 126 are specifically written for a particular GPUhardware.

Referring to FIG. 1A and FIG. 1B, the OpenGL driver architecture 100 isdesigned to operate with a first GPU 127, whereas the Vulkan driverarchitecture 150 is designed to operate with a second GPU 128. Accordingto some embodiments, the GPU 127 may be optimized for OpenGL, whereasthe GPU 128 may be optimized for OpenGL and/or Vulkan. In other words,the GPU 128 may be of the same type as the GPU 127, or it may be of atype that is particularly configured for use with Vulkan. Thus, theOpenGL driver architecture 100 provides the GPU 127 with instructionsbased on an application making OpenGL API calls, whereas the Vulkanarchitecture 150 provides the GPU 128 with instructions based on anapplication making Vulkan API calls. As such, when the GPU 128 isoptimized for Vulkan, the OpenGL driver architecture 100 is incapable ofproviding instructions to the GPU 128 that fully utilize thecapabilities of Vulkan.

According to some embodiments, it is possible to achieve a driverarchitecture that provides the GPU 128 with instructions based on anOpenGL API call (e.g. via dispatch module 116) through the use of atranslator module that links the OpenGL render module 120 with theVulkan render module 124. With the use of a translator module, thedispatch module 116, state tracker 118, render module 120, render module124, and carddata module 126 can be used to provide the GPU 128 withinstructions based on an application making OpenGL API calls.

An OpenGL-on-Vulkan driver architecture 200 is shown in FIG. 2. Thedriver architecture 200 can be described in terms of an OpenGL drivercomponent 210, a translator component 212, and a Vulkan driver component214. These components are distinguished in order to describe theoperability of the driver architecture 200 in terms of the OpenGLcomponents (analogous to OpenGL driver architecture 100), the Vulkancomponents (analogous to the Vulkan driver architecture 150), and thetranslator module that links them. This is accomplished by keeping theOpenGL-specific and hardware-agnostic modules of the driver architecture100, and substituting the hardware-specific modules with the Vulkanequivalent of the low-level and hardware-specific modules from thedriver architecture 150.

The OpenGL driver component 210 comprises a dispatch module 216 and anOpenGL state tracker 218, which, according to some embodiments, aregenerally the same as the dispatch module 116 and state tracker 118 aspreviously described.

The OpenGL driver component 210 also includes a render module 220.According to some embodiments, the render module 220 may be generallythe same as the render module 120. However, according to otherembodiments, the render module 220 may be a “thin” render module ascompared to the render module 120. The thin render module is used totrack and allocate resources that will be submitted to the translatormodule 222. According to some embodiments, the use of a thin rendermodule 220 allows for the render module 220 to be hardware agnostic.

Unlike the render module 120, render module 220 does not need tocontribute to providing instructions to a GPU, and, as such, can bedesigned in order to be hardware agnostic. With this approach, it ispossible to achieve an OpenGL-on-Vulkan driver architecture 200 in whichthe entire OpenGL driver component 210 is hardware-agnostic (i.e. asingle OpenGL driver component 210 can be used with any GPU). Accordingto some embodiments, the OpenGL render module 220 is responsible fortracking and allocating resources prior to issuing a call to thetranslator module 222, as well as invoking the translator module 222.

The translator component 212 comprises a translator module 222. Thetranslator module 222 is responsible for gathering the OpenGL stateinformation and draw commands, and translating those commands intoVulkan commands and state information, as well as generating anyVulkan-specific state/object in order to submit a Vulkan operation.

According to some embodiments, when an application initiates an OpenGLAPI call, the application is unaware that, at some point, a Vulkandriver will be involved in executing the operation. In this way, the APIcall travels through the OpenGL driver component 210, and as it entersthe translator component 212, the call is transformed to a Vulkanoperation. As the operation exits the translator component 212 andenters the Vulkan driver component 214, the Vulkan driver is unawarethat the operation originated in an OpenGL application.

There are two main variants of the OpenGL API that are commonly used: afixed-function pipeline, and a programmable pipeline. These variantsresult from the fact that modern GPUs contain very few fixed-functionstages, and most operations are performed by programmable shaders thatare executed on the GPU.

In the fixed-function pipeline version, an OpenGL driver enables anddisables a number of states and specific functionalities (e.g. lighting,fog, etc.) and then issues a draw operation. Fixed-function OpenGLdrivers managing modern GPUs need to generate shader code behind thescenes in order to simulate the fixed-function hardware stages.

In the programmable pipeline version of OpenGL, most of thesefixed-function functionalities are implemented by the application inshader code written using GLSL and compiled into a GPU's instruction setarchitecture (ISA) by a GPU-specific shader compiler.

In the case of fixed-function drivers, there are two ways in whichOpenGL on Vulkan can compile and generate the necessary shaders: ISA andSP IR-V.

The OpenGL component 210 of the driver 200 can compile ISA shader codebased on OpenGL state information just like the OpenGL driver 100 does,and submit the ISA shader to the translator component 212. In turn, thetranslator component 212 provides the ISA shader to the Vulkan driver toload “as is”.

Alternatively, the OpenGL driver can compile the shader using the SPIR-Vshader language, and submit that to the Vulkan driver. The advantage ofthis approach is that the OpenGL driver component 210 does not need tobe updated for future GPU generations.

The OpenGL-on-Vulkan driver architecture 200 handles the programmablepipeline version similar to the fixed-function approach. The differencebetween the two approaches is that the application provides the shadercode written in the GLSL language. If a GLSL to ISA compiler is used,then the OpenGL driver component 210 provides the ISA shader to thetranslator component 212 for the Vulkan driver component 214 to load “asis”. If a GLSL to SPIR-V compiler is provided then SPIR-V will beprovided to the translator component 212, which in turn will pass it tothe Vulkan driver component 214 to convert to ISA.

Referring to FIG. 3, there is shown an example 300 of how theOpenGL-on-Vulkan driver architecture 200 can be used to load atwo-dimensional texture image using glTexImage2D.

In computer graphics, textures are common means to add detail to ascene. Therefore, loading a texture is a ubiquitous operation inapplications written for OpenGL.

As will be described in further detail below, the OpenGL drivercomponent 310 validates the OpenGL API parameters and breaks down thecall into state and operation components. The state is then passed alongto the translator component 312 along with the desired render operation.

The translator component 312, using the translator module 322, gathersstate information from the OpenGL driver component 310 and translatesthe state information into Vulkan typed states. The translator module322 translates the OpenGL operation into a Vulkan operation and callsthe Vulkan driver component 314 in order to eventually execute theoperation on the GPU 328.

The Vulkan driver component 314 gathers the state information anddesired operation and uses the Vulkan render module 324 to generatehardware-specific commands to execute the operation. The Vulkan rendermodule 324 then calls the carddata module 326 in order to execute theoperation on the GPU 328.

The call is initiated in the application as glTexImage2D( ), and entersthe OpenGL driver component 310 through the dispatch module 316. Thedispatch module 316 converts this into an internal call to theappropriate state-tracker function. The state tracker 316 generates andstores OpenGL state information pertaining to the texture object. Thisincludes dimensions, format, etc.

From the state tracker 318, the operation proceeds to the render module320. In the render module 320, the texture is placed on a temporarylocation accessible by the GPU (if applicable), and the translatormodule 322 is invoked to load the texture.

After the translator module 322 is invoked, it is responsible formarshalling the texture object and its OpenGL state into a Vulkanoperation. This means translating from OpenGL formats to Vulkan formats.For example, the OpenGL format GL_RGBA can be translated toVK_FORMAT_R8G8B8A8_UNIT, and GL_TEXTURE_2D can be translated toVK_IMAGE_TYPE_2D. Additionally, a Vulkan pipeline, memory, commandbuffer (indirect buffer), and shader objects can be generated.

Once the translator module 322 formulates a Vulkan operation, it submitsthe operation to the Vulkan driver component 314 via the appropriatecommand queues. Subsequently, the Vulkan driver component 314 isresponsible for formatting the Vulkan commands into hardware-specificoperations for the GPU.

Referring to FIG. 4, there is shown an example 400 of how theOpenGL-on-Vulkan driver architecture 200 can be used to submit a drawcommand using glDrawArrays.

OpenGL is a state machine where most of the APIs are involved in therecording of state information. It is during a draw operation that allof the recorded state will be checked and submitted to the GPU 428 toaffect the output of the operation. glDrawArrays is a common way tosubmit a draw command to the GPU 428.

As in the example 300, the call is marshalled through the dispatchmodule 416 and onto the state tracker 418. At this point, relevant stateinformation is stored, and auxiliary operations are performed likeloading transformation matrices to a location in system memory to beloaded later as a constant.

The operation proceeds to the render module 420, where a number ofimportant tasks are performed: lower-level state information is storedand tracked (e.g. state flags are dirtied where applicable), vertexdata, constants, texture samplers, texture resources are loaded totemporary system memory locations (or compiled in a way that can bepresented to the Vulkan translator module 422), SPIR-V shaders aregenerated and loaded (or compiles in a way that can be presented to theVulkan translator module 422), and a draw command is generated andsubmitted to the translator module 422. Subsequently, the translatormodule 422 is responsible for converting the OpenGL state information,and generating a Vulkan-style draw operation to submit to the Vulkandriver component 414.

Referring to FIG. 5, there is shown an OpenGL-on-Vulkan driverarchitecture 500 that includes a translator to Window System Integration(WSI).

Generally speaking, the OpenGL API allows an application to render colordata to a render buffer in video memory. If the render surface were tobe displayed on a screen, then a second API would be needed in order tobridge the gap between offscreen rendering and onscreen rendering. TheOpenGL API, alone, does not describe a method for the offscreen surfaceto be displayed.

There are a number of APIs that allow an application to associate anative display to a render context and render surface. These APIs tendto be platform specific, with windows providing WGL, X Windows systemsproviding GLX, and embedded platforms generally using EGL.

These APIs vary syntactically and some are better suited for certain usecases than the others. In essence, they all accomplish the same thing:the ability to create a graphics context and associate that context witha render surface, and a native display and windowing system, where thenative display is a handle to the display driver's display connection.

With the introduction of Vulkan, a new windowing API has emerged tobridge the gap between render surfaces and the native display.Specifically, Vulkan includes Window System Integration (WSI). UnlikeEGL, WGL, and GLX, WSI aims to be cross-platform.

According to some embodiments, the OpenGL-on-Vulkan driver architecture500 may ensure that an OpenGL application need not be aware that it isrunning on top of a Vulkan driver. Thus, it follows that an applicationthat uses EGL need not be aware that it is running on top of WSI.

In the example shown in FIG. 5, an OpenGL-on-Vulkan driver architecture500 uses EGL on WSI. The EGL API provides a list of functions that anapplication can use to create a graphics context, a render surface, adisplay, and associate the three as the current render targets.

As an example, the EGL application may make API calls in the followingorder. A call can be made to create an EGL display and associate thatdisplay with a native display connection using“eglDisplay=eglGetDisplay(handleToNativeDisplay)”. On windows, this maybe a handle to the device context or hDC. Then, the EGL displaystructure can be initialized using eglInitialize(eglDisplay). An EGLconfiguration matching the provided attributes (color buffer size, depthbuffer size, etc.) can be chosen using eglChooseConfig( ). An EGLsurface can be created and associated with the EGL display and nativewindowing system using eglCreateWindowSurface( ) Then, a graphicscontext can be created and associated with the EGL display usingeglCreateContext( ) Finally, a context can be associated with an EGLdisplay and an EGL surface, and these can be made the current rendertarget using eglMakeCurrent( ).

In order to accomplish the above, and utilize WSI in Vulkan, thetranslator module 522 can translate the EGL (or GLX or WGL) into anequivalent WSI call. The translator module 522 receives the EGL (or WGLor GLX) function 530, translates it to the equivalent WSI call 532,which is then sent to the GPU 528.

Referring now to FIG. 7, illustrated therein are exemplary performanceanalysis data 700 and 750 according to one embodiment. The performanceanalysis data 700 are based on a benchmark test using an AMD™ OpenGL ES2 driver. The performance analysis data 750 are based on a benchmarktest using the Vulkan SC 2 layer (e.g., as described herein). The graphs710 and 760 show CPU utilization (% weight using resource time), and thegraphs 712 and 762 show GPU utilization (utilization as resource time).

Referring now to FIG. 8, illustrated therein are exemplary performanceanalysis data 800 according to one embodiment. The graph 810 shows CPUutilization, and the graph 860 shows GPU utilization. The curves 812 and862 represent a rendering test using Vulkan, and the curves 814 and 864represent a rendering test using GL ES 2.0. As can be seen, the Vulkantest was concluded in a total time of 51.6 seconds, whereas the GL ES2.0 test was concluded in a total time of 55.6 seconds. The overlaycomparisons shown in the graphs 810 and 860 show less CPU usage toachieve full GPU loading, as shown in the middle section of the curves.These results also show that the GPU and CPU usage is more even andconstant under most conditions using the Vulkan API instead of the GLAPI.

In respect of immediate-mode rendering design, benchmark testingverifies that, at the time of glDrawArray or glDrawRangeElement, vertexand index data are copied to Circularly accessed VBO and IBOs. Uniformdata are updated in Descriptor Set. Binding of VBO and IBOs is queuedbefore a draw command with binding point starting at the start of datawrite, and the draw command is queued.

When circular buffers are half full, or some number of draw commandshave been put in the queue, the queue is sent to the GPU. In some cases,for example, this may be set to occur with 1,000 draw commands, or when500 Bytes of vertex data are achieved.

Vulkan uses Pipelines that are combinations of the vertex and fragmentshader code, fetch shader definition, and render state setup (primitivetype, clipping, viewport, depth bounds, etc.). To allow use of a GLProgram concept, there is a composite object that holds the shader codeand definition of the VS attributes and uniforms, and a list ofpipelines that can represent the program. Each pipeline can maintain aset of data of the properties that make that pipeline unique.

While the above description provides examples of one or more apparatus,methods, or systems, it will be appreciated that other apparatus,methods, or systems may be within the scope of the claims as interpretedby one of skill in the art.

1-12. (canceled)
 13. A method for using an OpenGL API with a Vulkangraphics driver for a graphics processing unit, the method executed atrun-time by at least one processor, the method comprising: receiving anOpenGL context, a plurality of OpenGL objects bound to the OpenGLcontext, and an OpenGL render command; compiling a SPIR-V shader basedon the OpenGL render command and the OpenGL context; and in response tocompiling the SPIR-V shader: creating a plurality of Vulkan objectsbased on the OpenGL objects; setting a plurality of Vulkan object statesfor the plurality of Vulkan objects; based on the plurality of Vulkanobjects and Vulkan object states, generating a plurality of Vulkancommands in a Vulkan command buffer; and in response to generating theplurality of Vulkan commands, re-compiling the SPIR-V shader to generatea specific shader in an instruction set architecture of the graphicsprocessing unit.
 14. The method of claim 13, wherein the OpenGL contexthas having an associated context state, and wherein each of theplurality of OpenGL objects have respective associated object states.15. The method of claim 14, wherein setting the plurality of Vulkanobject states is based on the plurality of associated object states forthe plurality of OpenGL objects bound to the OpenGL context, and furtherbased on the associated context state for the OpenGL context.
 16. Themethod of claim 13, wherein at least one of the OpenGL objects is atexture object, the respective OpenGL format is an OpenGL image format,and the respective Vulkan format is a Vulkan image format, wherein theplurality of Vulkan objects is created based on the respective Vulkanformats.
 17. The method of claim 13, further comprising translatingrespective OpenGL formats of each of the OpenGL objects to respectiveVulkan formats, wherein at least one of the OpenGL formats correspondsto GL_RGBA and the respective Vulcan format corresponds toVK-FORMAT_R8G8B8A8_UINT.
 18. The method of claim 13, wherein at leastone of the OpenGL objects is of a type GL_TEXTURE_1D and the respectiveVulkan object is of a type VKIMAGE_TYPE_1D.
 19. The method of claim 13,wherein at least one of the OpenGL objects is of a type GL_TEXTURE_2Dand the respective Vulkan object is of a type VK_IMAGE_TYPE_2D.
 20. Themethod of claim 13, wherein at least one of the OpenGL objects is of atype GL_TEXTURE_3D and the respective Vulkan object is of a typeVK_IMAGE_TYPE_3D.
 21. The method of claim 13, wherein at least one ofthe OpenGL formats corresponds to GL_TRIANGLES and the respective Vulkanformat corresponds to VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST.
 22. Acomputing device configured to use an OpenGL API with a Vulkan graphicsdriver, the computing device comprising: a graphics processing unit; atleast one processor; and a memory, the memory comprising executablecomputer instruction code, which when executed by the at least oneprocessor at run-time, causes the at least one processor to perform amethod for using an OpenGL API with a Vulkan graphics driver for agraphics processing unit, the method comprising: receiving an OpenGLcontext, a plurality of OpenGL objects bound to the OpenGL context, andan OpenGL render command; compiling a SPIR-V shader based on the OpenGLrender command and the OpenGL context; and in response to compiling theSPIR-V shader: creating a plurality of Vulkan objects based on theOpenGL objects; setting a plurality of Vulkan object states for theplurality of Vulkan objects; based on the plurality of Vulkan objectsand Vulkan object states, generating a plurality of Vulkan commands in aVulkan command buffer; and in response to generating the plurality ofVulkan commands, re-compiling the SPIR-V shader to generate a specificshader in an instruction set architecture of the graphics processingunit.
 23. A non-transitory, computer-readable medium, comprising anOpenGL render routine comprising computer instruction code that isexecutable by at least one processor at run-time, the computerinstruction code when executed by the at least one processor causing theat least one processor to perform a method for using an OpenGL API witha Vulkan graphics driver for a graphics processing unit, the methodcomprising receiving an OpenGL context, a plurality of OpenGL objectsbound to the OpenGL context, and an OpenGL render command; compiling aSPIR-V shader based on the OpenGL render command and the OpenGL context;and in response to compiling the SPIR-V shader: creating a plurality ofVulkan objects based on the OpenGL objects; setting a plurality ofVulkan object states for the plurality of Vulkan objects; based on theplurality of Vulkan objects and Vulkan object states, generating aplurality of Vulkan commands in a Vulkan command buffer; and in responseto generating the plurality of Vulkan commands, re-compiling the SPIR-Vshader to generate a specific shader in an instruction set architectureof the graphics processing unit.
 24. The non-transitory,computer-readable medium of claim 23, wherein the OpenGL context hashaving an associated context state, and wherein each of the plurality ofOpenGL objects have respective associated object states.
 25. Thenon-transitory, computer-readable medium of claim 24, wherein settingthe plurality of Vulkan object states is based on the plurality ofassociated object states for the plurality of OpenGL objects bound tothe OpenGL context, and further based on the associated context statefor the OpenGL context.
 26. The non-transitory, computer-readable mediumof claim 23, wherein at least one of the OpenGL objects is a textureobject, the respective OpenGL format is an OpenGL image format, and therespective Vulkan format is a Vulkan image format, wherein the pluralityof Vulkan objects is created based on the respective Vulkan formats. 27.The non-transitory, computer-readable medium of claim 23, wherein atleast one of the OpenGL formats corresponds to GL_RGBA and therespective Vulcan format corresponds to VK-FORMAT_R8G8B8A8_UINT.
 28. Thenon-transitory, computer-readable medium of claim 23, wherein at leastone of the OpenGL objects is of a type GL_TEXTURE_1D and the respectiveVulkan object is of a type VK_IMAGE_TYPE_1D.
 29. The non-transitory,computer-readable medium of claim 23, wherein at least one of the OpenGLobjects is of a type GL_TEXTURE_2D and the respective Vulkan object isof a type VK_IMAGE_TYPE_2D.
 30. The non-transitory, computer-readablemedium of claim 23, wherein at least one of the OpenGL objects is of atype GL_TEXTURE_3D and the respective Vulkan object is of a typeVK_IMAGE_TYPE_3D.
 31. The non-transitory, computer-readable medium ofclaim 23, wherein at least one of the OpenGL formats corresponds toGL_TRIANGLES and the respective Vulkan format corresponds toVKPRIMITIVE_TOPOLOGYTRIANGLE_LIST.